example RDF Jena

schema S = literal : sql {
	entities
		Employee
		Department
	foreign_keys
		manager   : Employee -> Employee
		worksIn   : Employee -> Department
		secretary : Department -> Employee
	path_equations
		Employee.manager.worksIn = Employee.worksIn
  		Department.secretary.worksIn = Department
  	attributes
  		first last	: Employee -> String
     	age			: Employee -> Integer
     	name 		: Department -> String
}

instance I = literal : S {
	generators
		a b c : Employee
		m s : Department
	equations
		first(a) = Al
		first(b) = Bob  last(b) = Bo
		first(c) = Carl
		name(m)  = Math name(s) = CS
		age(a) = age(c)
		manager(a) = b manager(b) = b manager(c) = c
		worksIn(a) = m worksIn(b) = m worksIn(c) = s
		secretary(s) = c secretary(m) = b
		secretary(worksIn(a)) = manager(a)
		worksIn(a) = worksIn(manager(a))
		age(a) = "2"
		age(manager(a)) = "1"
}

command exportRdfData = export_rdf_instance_xml I "file.xml" {
	external_types
		Integer -> "http://www.w3.org/2001/XMLSchema#Integer" "x => x.toString()"
}

instance J = import_rdf_all "file.xml" #can import from .ttl too

instance K = spanify J
Keywords:

schema_literal
export_rdf_instance_xml
spanify
import_rdf_all
instance_literal

Options:




instance I

Department
IDnamesecretary
0Math3
1CS4
Employee
IDfirstlastagemanagerworksIn
2Al?0230
3BobBo130
4Carl?1241


instance J

R
IDpredicatesubjectobject
0cql://attribute/Employee/firstcql://entity/Employee/0Carl
1cql://attribute/Employee/agecql://entity/Employee/02
2cql://foreign_key/Employee/managercql://entity/Employee/0cql://entity/Employee/0
3cql://foreign_key/Employee/worksIncql://entity/Employee/0cql://entity/Department/0
4http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Employee/0cql://entity/Employee
5http://www.w3.org/2000/01/rdf-schema#domaincql://attribute/Employee/lastcql://entity/Employee
6http://www.w3.org/2000/01/rdf-schema#rangecql://attribute/Employee/lasthttp://www.w3.org/2001/XMLSchema#String
7http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/Employee/lasthttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
8cql://attribute/Department/namecql://entity/Department/1Math
9cql://foreign_key/Department/secretarycql://entity/Department/1cql://entity/Employee/1
10http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Department/1cql://entity/Department
11http://www.w3.org/2000/01/rdf-schema#domaincql://attribute/Department/namecql://entity/Department
12http://www.w3.org/2000/01/rdf-schema#rangecql://attribute/Department/namehttp://www.w3.org/2001/XMLSchema#String
13http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/Department/namehttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
14http://www.w3.org/2000/01/rdf-schema#domaincql://attribute/Employee/agecql://entity/Employee
15http://www.w3.org/2000/01/rdf-schema#rangecql://attribute/Employee/agehttp://www.w3.org/2001/XMLSchema#Integer
16http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/Employee/agehttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
17http://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/Employee/worksIncql://entity/Employee
18http://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/Employee/worksIncql://entity/Department
19http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/Employee/worksInhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
20http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Departmenthttp://www.w3.org/2000/01/rdf-schema#Class
21cql://attribute/Employee/firstcql://entity/Employee/1Bob
22cql://attribute/Employee/lastcql://entity/Employee/1Bo
23cql://attribute/Employee/agecql://entity/Employee/11
24cql://foreign_key/Employee/managercql://entity/Employee/1cql://entity/Employee/1
25cql://foreign_key/Employee/worksIncql://entity/Employee/1cql://entity/Department/1
26http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Employee/1cql://entity/Employee
27http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#Class
28http://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/Employee/managercql://entity/Employee
29http://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/Employee/managercql://entity/Employee
30http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/Employee/managerhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
31cql://attribute/Department/namecql://entity/Department/0CS
32cql://foreign_key/Department/secretarycql://entity/Department/0cql://entity/Employee/0
33http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Department/0cql://entity/Department
34http://www.w3.org/2000/01/rdf-schema#domaincql://foreign_key/Department/secretarycql://entity/Department
35http://www.w3.org/2000/01/rdf-schema#rangecql://foreign_key/Department/secretarycql://entity/Employee
36http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://foreign_key/Department/secretaryhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
37cql://attribute/Employee/firstcql://entity/Employee/2Al
38cql://attribute/Employee/agecql://entity/Employee/22
39cql://foreign_key/Employee/managercql://entity/Employee/2cql://entity/Employee/1
40cql://foreign_key/Employee/worksIncql://entity/Employee/2cql://entity/Department/1
41http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://entity/Employee/2cql://entity/Employee
42http://www.w3.org/2000/01/rdf-schema#domaincql://attribute/Employee/firstcql://entity/Employee
43http://www.w3.org/2000/01/rdf-schema#rangecql://attribute/Employee/firsthttp://www.w3.org/2001/XMLSchema#String
44http://www.w3.org/1999/02/22-rdf-syntax-ns#typecql://attribute/Employee/firsthttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property


instance K

cql://attribute/Department/name
IDsubjectobject
0cql://entity/Department/1Math
1cql://entity/Department/0CS
cql://attribute/Employee/age
IDsubjectobject
2cql://entity/Employee/02
3cql://entity/Employee/11
4cql://entity/Employee/22
cql://attribute/Employee/first
IDsubjectobject
5cql://entity/Employee/0Carl
6cql://entity/Employee/1Bob
7cql://entity/Employee/2Al
cql://attribute/Employee/last
IDsubjectobject
8cql://entity/Employee/1Bo
cql://foreign_key/Department/secretary
IDsubjectobject
9cql://entity/Department/1cql://entity/Employee/1
10cql://entity/Department/0cql://entity/Employee/0
cql://foreign_key/Employee/manager
IDsubjectobject
11cql://entity/Employee/0cql://entity/Employee/0
12cql://entity/Employee/1cql://entity/Employee/1
13cql://entity/Employee/2cql://entity/Employee/1
cql://foreign_key/Employee/worksIn
IDsubjectobject
14cql://entity/Employee/0cql://entity/Department/0
15cql://entity/Employee/1cql://entity/Department/1
16cql://entity/Employee/2cql://entity/Department/1
http://www.w3.org/1999/02/22-rdf-syntax-ns#type
IDsubjectobject
17cql://entity/Employee/0cql://entity/Employee
18cql://attribute/Employee/lasthttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
19cql://entity/Department/1cql://entity/Department
20cql://attribute/Department/namehttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
21cql://attribute/Employee/agehttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
22cql://foreign_key/Employee/worksInhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
23cql://entity/Departmenthttp://www.w3.org/2000/01/rdf-schema#Class
24cql://entity/Employee/1cql://entity/Employee
25cql://entity/Employeehttp://www.w3.org/2000/01/rdf-schema#Class
26cql://foreign_key/Employee/managerhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
27cql://entity/Department/0cql://entity/Department
28cql://foreign_key/Department/secretaryhttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
29cql://entity/Employee/2cql://entity/Employee
30cql://attribute/Employee/firsthttp://www.w3.org/1999/02/22-rdf-syntax-ns#Property
http://www.w3.org/2000/01/rdf-schema#domain
IDsubjectobject
31cql://attribute/Employee/lastcql://entity/Employee
32cql://attribute/Department/namecql://entity/Department
33cql://attribute/Employee/agecql://entity/Employee
34cql://foreign_key/Employee/worksIncql://entity/Employee
35cql://foreign_key/Employee/managercql://entity/Employee
36cql://foreign_key/Department/secretarycql://entity/Department
37cql://attribute/Employee/firstcql://entity/Employee
http://www.w3.org/2000/01/rdf-schema#range
IDsubjectobject
38cql://attribute/Employee/lasthttp://www.w3.org/2001/XMLSchema#String
39cql://attribute/Department/namehttp://www.w3.org/2001/XMLSchema#String
40cql://attribute/Employee/agehttp://www.w3.org/2001/XMLSchema#Integer
41cql://foreign_key/Employee/worksIncql://entity/Department
42cql://foreign_key/Employee/managercql://entity/Employee
43cql://foreign_key/Department/secretarycql://entity/Employee
44cql://attribute/Employee/firsthttp://www.w3.org/2001/XMLSchema#String


command exportRdfData

Size 45